package com.hyl.design;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.InputStream;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @Description 代理对象
 * @Author com.com.hyl
 * @Date 2022/9/13 11:03
 **/
public class IntermediaryInvocationhandler implements InvocationHandler {

	private Object target;//真正代理的对象


	public Object invoke(Object proxy, Method method, Object[] args)
			throws Throwable{

		Object ret = method.invoke(target, args); //调用 ==> 真正代理的对象

		return ret;
	}


	public void setTarget(Object target) {
		this.target = target;
	}
}
